package com.fly.graphql_demo.business.user.data

import com.baomidou.mybatisplus.annotation.*
import com.baomidou.mybatisplus.core.mapper.BaseMapper
import org.apache.ibatis.annotations.Mapper
import java.util.*

@TableName("users")
data class User(
    @TableId(type = IdType.AUTO)
    var id: String? = null,
    var name: String? = null,
    var email: String? = null,
    var age: Int? = null,
    @TableField(fill = FieldFill.INSERT)
    var birthday: Date? = null
)

@Mapper
interface UserMapper: BaseMapper<User>

data class UserList(
    var users: List<User>? = null,
    var total: Int? = 0
)

data class UserParam(
    var id: String? = null,
    var name: String? = null,
    var email: String? = null,
    var age: Int? = null,
    var birthday: Date? = null
)